{smcl}
{txt}{sf}{ul off}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}\\file\UsersW$\wrr15\Home\My Documents\My Files\XINDONG XUE\META-ANALYSIS\REVISION FOR JHE\DATA AND CODE\Part1 Results(20191130).smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}30 Nov 2019, 10:50:23
{txt}
{com}. use "sc_data(20191130).dta"
{txt}
{com}. 
. ******************************************************************************
. *DEFINITION OF BASIC VARIABLES
. ******************************************************************************
. gen tstat = real(tstatistics)
{txt}(1 missing value generated)

{com}. gen negative = 1
{txt}
{com}. replace negative = -1 if ((badhealth == 1 & badsc == 0) | (badhealth == 0 & badsc == 1))
{txt}(5,727 real changes made)

{com}. replace tstat = tstat*negative
{txt}(5,656 real changes made)

{com}. gen df = nobs
{txt}
{com}. gen obsno = _n
{txt}
{com}. replace df = . if tstat == .
{txt}(1 real change made, 1 to missing)

{com}. gen r = tstat/sqrt(tstat^2+df)
{txt}(1 missing value generated)

{com}. gen varR = (1-r^2)/df
{txt}(1 missing value generated)

{com}. gen seR = sqrt(varR)
{txt}(1 missing value generated)

{com}. gen pcc = r
{txt}(1 missing value generated)

{com}. 
. // Study Type
. describe journal

              {txt}storage   display    value
variable name   type    format     label      variable label
{hline}
{p 0 48}{res}{bind:journal        }{txt}{bind: str69   }{bind:{txt}%69s      }{space 1}{bind:         }{bind:  }{res}{res}{p_end}
{txt}
{com}. gen journal2 = journal
{txt}(305 missing values generated)

{com}. encode journal, gen(njournal)
{txt}
{com}. drop journal
{txt}
{com}. gen journal=(njournal != .)
{txt}
{com}. summ pubyear

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 5}pubyear {c |}{res}     13,041    2009.314    6.112613       1985       2017
{txt}
{com}. replace pubyear = pubyear - r(mean)
{txt}variable {bf}pubyear{sf} was {bf}{res}int{sf}{txt} now {bf}{res}float{sf}
{txt}(13,041 real changes made)

{com}. 
. 
. // Countries
. gen eastasia=(country_region=="East_Asia")
{txt}
{com}. gen usa=(country_region=="USA")
{txt}
{com}. gen westnortheurope=(country_region=="West_North_Europe")
{txt}
{com}. gen highincome=(country_region=="High-income countries")
{txt}
{com}. gen othercountry = 1 - eastasia - usa - westnortheurope - highincome
{txt}
{com}. 
. // Social Capital Measures
. gen cognitivestructual2 = cognitivestructual
{txt}(1,071 missing values generated)

{com}. replace cognitivestructual = (cognitivestructual2 == 0 | cognitivestructual2 == 1)
{txt}(4,765 real changes made)

{com}. gen bondingbridginglinking2 = bondingbridginglinking
{txt}(9,415 missing values generated)

{com}. replace bondingbridginglinking = (bondingbridginglinking2 == 0 | bondingbridginglinking2 == 1 | bondingbridginglinking2 == 2)
{txt}(11,807 real changes made)

{com}. gen both = (cognitivestructual == 1 & bondingbridginglinking == 1)
{txt}
{com}. 
. // Estimation Method
. gen otherestimation = 1 - ols - fgls - probitlogit - orderedprobitlogit - orhr - hlm - iv 
{txt}(45 missing values generated)

{com}. 
. // Calculation of t-statistic
. gen tcalculatedbyci=(tcalculatedbycise==1 & cilowerbound != .)
{txt}
{com}. gen tcalculatedbypvalue2 = tcalculatedbypvalue
{txt}(10,517 missing values generated)

{com}. replace tcalculatedbypvalue = (tcalculatedbypvalue2 == 1)
{txt}(10,517 real changes made)

{com}. gen tnormal = 1 - tcalculatedbyci - tcalculatedbypvalue
{txt}
{com}. 
. 
. 
. *************************************
. *************************************
. *************************************
. ************ TABLE 3 ****************
. *************************************
. *************************************
. *************************************
. 
. ******************************************************************************
. * Distribution of t-stats, df, and PCCs before kicking out outliers
. ******************************************************************************
. summ tstat, detail

                            {txt}tstat
{hline 61}
      Percentiles      Smallest
 1%    {res}-4.906542      -59.66667
{txt} 5%    {res}-2.662089      -34.28571
{txt}10%    {res}-1.748998      -34.28571       {txt}Obs         {res}     13,040
{txt}25%    {res}-.3099753      -17.44341       {txt}Sum of Wgt. {res}     13,040

{txt}50%    {res} 1.201969                      {txt}Mean          {res} 1.666258
                        {txt}Largest       Std. Dev.     {res}  8.39527
{txt}75%    {res} 2.742033       48.85714
{txt}90%    {res} 4.701832       60.71429       {txt}Variance      {res} 70.48057
{txt}95%    {res} 7.164494         123.75       {txt}Skewness      {res} 79.59073
{txt}99%    {res} 15.34226            850       {txt}Kurtosis      {res} 8001.604
{txt}
{com}. summ df, detail 

                             {txt}df
{hline 61}
      Percentiles      Smallest
 1%    {res}       39              5
{txt} 5%    {res}      190              5
{txt}10%    {res}      412              5       {txt}Obs         {res}     13,040
{txt}25%    {res}   1034.5              5       {txt}Sum of Wgt. {res}     13,040

{txt}50%    {res}     3300                      {txt}Mean          {res} 29023.19
                        {txt}Largest       Std. Dev.     {res} 201647.9
{txt}75%    {res}     7845        2442948
{txt}90%    {res}    23153        2442948       {txt}Variance      {res} 4.07e+10
{txt}95%    {res}    44986        2442948       {txt}Skewness      {res} 10.39608
{txt}99%    {res}   271642        2442948       {txt}Kurtosis      {res}  113.916
{txt}
{com}. summ pcc, detail

                             {txt}pcc
{hline 61}
      Percentiles      Smallest
 1%    {res}-.1565824      -.7468062
{txt} 5%    {res}-.0607837      -.6988937
{txt}10%    {res}-.0330991      -.6669519       {txt}Obs         {res}     13,040
{txt}25%    {res}-.0039481      -.6589855       {txt}Sum of Wgt. {res}     13,040

{txt}50%    {res} .0194968                      {txt}Mean          {res} .0298341
                        {txt}Largest       Std. Dev.     {res} .0835638
{txt}75%    {res} .0528822       .7815421
{txt}90%    {res} .1017799       .8318966       {txt}Variance      {res} .0069829
{txt}95%    {res} .1427257       .9322937       {txt}Skewness      {res} 2.192736
{txt}99%    {res} .3611769       .9979269       {txt}Kurtosis      {res} 22.72598
{txt}
{com}. 
. ******************************************************************************
. * Kick out extreme values of PCC
. ******************************************************************************
. quietly summ pcc, detail
{txt}
{com}. keep if pcc > r(p1) & pcc < r(p99) 
{txt}(263 observations deleted)

{com}. 
. summ tstat, detail

                            {txt}tstat
{hline 61}
      Percentiles      Smallest
 1%    {res}    -4.37      -17.44341
{txt} 5%    {res}-2.577466      -17.17949
{txt}10%    {res}-1.627807      -16.92308       {txt}Obs         {res}     12,778
{txt}25%    {res}-.2669279      -16.30291       {txt}Sum of Wgt. {res}     12,778

{txt}50%    {res} 1.201969                      {txt}Mean          {res} 1.596459
                        {txt}Largest       Std. Dev.     {res} 3.527057
{txt}75%    {res} 2.704082             39
{txt}90%    {res} 4.666667       39.17137       {txt}Variance      {res} 12.44013
{txt}95%    {res} 7.018824       40.86186       {txt}Skewness      {res} 2.722731
{txt}99%    {res} 14.60096       48.85714       {txt}Kurtosis      {res} 23.17107
{txt}
{com}. summ df, detail 

                             {txt}df
{hline 61}
      Percentiles      Smallest
 1%    {res}       49              5
{txt} 5%    {res}      244              5
{txt}10%    {res}      462             14       {txt}Obs         {res}     12,778
{txt}25%    {res}     1147             14       {txt}Sum of Wgt. {res}     12,778

{txt}50%    {res}     3451                      {txt}Mean          {res} 29600.22
                        {txt}Largest       Std. Dev.     {res} 203663.3
{txt}75%    {res}     7973        2442948
{txt}90%    {res}    23153        2442948       {txt}Variance      {res} 4.15e+10
{txt}95%    {res}    44986        2442948       {txt}Skewness      {res} 10.28898
{txt}99%    {res}  1358932        2442948       {txt}Kurtosis      {res} 111.6018
{txt}
{com}. summ pcc, detail

                             {txt}pcc
{hline 61}
      Percentiles      Smallest
 1%    {res}-.1127038      -.1565255
{txt} 5%    {res}-.0546759        -.15583
{txt}10%    {res}-.0307116      -.1553387       {txt}Obs         {res}     12,778
{txt}25%    {res}-.0035939      -.1545959       {txt}Sum of Wgt. {res}     12,778

{txt}50%    {res} .0194968                      {txt}Mean          {res} .0277448
                        {txt}Largest       Std. Dev.     {res}  .059443
{txt}75%    {res} .0518454       .3584205
{txt}90%    {res} .0972992       .3586976       {txt}Variance      {res} .0035335
{txt}95%    {res} .1315362       .3596016       {txt}Skewness      {res} 1.182496
{txt}99%    {res} .2387999       .3598491       {txt}Kurtosis      {res} 7.388691
{txt}
{com}. 
. *************************************
. *************************************
. *************************************
. *********** FIGURE 1  ***************
. *************************************
. *************************************
. *************************************
. 
. ******************************************************************************
. * Characteristics of t-stats and PCCs of final data set
. ******************************************************************************
. 
. histogram tstat, bin(80) name(histTSTAT) fraction
{txt}(bin={res}80{txt}, start={res}-17.443409{txt}, width={res}.8287569{txt})
{res}{txt}
{com}. gen tstat1 = (tstat<-2)
{txt}
{com}. gen tstat2 = (tstat>=-2 & tstat<=2)
{txt}
{com}. gen tstat3 = (tstat>2)
{txt}
{com}. // NOTE: A lot of insignificant t-stats
. sum tstat1 tstat2 tstat3

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 6}tstat1 {c |}{res}     12,778    .0724683    .2592719          0          1
{txt}{space 6}tstat2 {c |}{res}     12,778    .5641728    .4958842          0          1
{txt}{space 6}tstat3 {c |}{res}     12,778    .3633589    .4809858          0          1
{txt}
{com}. 
. summ pcc, detail

                             {txt}pcc
{hline 61}
      Percentiles      Smallest
 1%    {res}-.1127038      -.1565255
{txt} 5%    {res}-.0546759        -.15583
{txt}10%    {res}-.0307116      -.1553387       {txt}Obs         {res}     12,778
{txt}25%    {res}-.0035939      -.1545959       {txt}Sum of Wgt. {res}     12,778

{txt}50%    {res} .0194968                      {txt}Mean          {res} .0277448
                        {txt}Largest       Std. Dev.     {res}  .059443
{txt}75%    {res} .0518454       .3584205
{txt}90%    {res} .0972992       .3586976       {txt}Variance      {res} .0035335
{txt}95%    {res} .1315362       .3596016       {txt}Skewness      {res} 1.182496
{txt}99%    {res} .2387999       .3598491       {txt}Kurtosis      {res} 7.388691
{txt}
{com}. histogram pcc, bin(80) name(histPCC) fraction
{txt}(bin={res}80{txt}, start={res}-.15652548{txt}, width={res}.00645468{txt})
{res}{txt}
{com}. 
. *************************************
. *************************************
. *************************************
. *********** FIGURE 2  ***************
. *************************************
. *************************************
. *************************************
. 
. histogram pcc if physicalhealth == 1, bin(80) name(histPhysHealth) fraction
{txt}(bin={res}80{txt}, start={res}-.15459593{txt}, width={res}.00641617{txt})
{res}{txt}
{com}. summ pcc if physicalhealth == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 9}pcc {c |}{res}      4,770    .0230682     .064912  -.1545959   .3586976
{txt}
{com}. histogram pcc if mentalhealth == 1, bin(80) name(histMentHealth) fraction 
{txt}(bin={res}80{txt}, start={res}-.15652548{txt}, width={res}.00629153{txt})
{res}{txt}
{com}. summ pcc if mentalhealth == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 9}pcc {c |}{res}      2,934    .0250497    .0624556  -.1565255   .3467972
{txt}
{com}. histogram pcc if generalhealth == 1, bin(80) name(histGenHealth) fraction
{txt}(bin={res}80{txt}, start={res}-.15448481{txt}, width={res}.00642917{txt})
{res}{txt}
{com}. summ pcc if generalhealth == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 9}pcc {c |}{res}      5,167    .0332573    .0513848  -.1544848   .3598491
{txt}
{com}. 
. ******************************************************************************
. * Relationship between t-stats and PCCs
. ******************************************************************************
. // This gives the correlation between pcc and tstat (= 0.65).
. corr pcc tstat
{txt}(obs=12,778)

             {c |}      pcc    tstat
{hline 13}{c +}{hline 18}
         pcc {c |}{res}   1.0000
       {txt}tstat {c |}{res}   0.6361   1.0000

{txt}
{com}. 
. ******************************************************************************
. * Relationship of PCCs over time
. ******************************************************************************
. bysort id: egen PCCmed = median(pcc)
{txt}
{com}. graph twoway (scatter PCCmed pubyear, msize(*0.5) msymbol(Oh) name(PCCtime)) (lfit PCCmed pubyear) 
{res}{txt}
{com}. // Not much change over time.
. 
. 
. *************************************
. *************************************
. *************************************
. ************ TABLE 4 ****************
. *************************************
. *************************************
. *************************************
. 
. // Study Type
. summ journal

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 5}journal {c |}{res}     12,778    .9767569    .1506805          0          1
{txt}
{com}. summ pubyear

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 5}pubyear {c |}{res}     12,778    .0330713    6.088708  -24.31401    7.68599
{txt}
{com}. // For our empirical analysis, we subtract off the mean
. replace pubyear = pubyear - r(mean)
{txt}(12,778 real changes made)

{com}. 
. 
. // Data Characteristics
. sum individualdata aggregatedata individualsc

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
individual~a {c |}{res}     12,778    .9758178    .1536205          0          1
{txt}aggregated~a {c |}{res}     12,778    .0259822    .1590882          0          1
{txt}individualsc {c |}{res}     12,778    .8653936     .341316          0          1
{txt}
{com}. sum panel cs

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 7}panel {c |}{res}     12,778    .4439662    .4968697          0          1
{txt}{space 10}cs {c |}{res}     12,778    .5560338    .4968697          0          1
{txt}
{com}. 
. // Countries
. summ eastasia usa westnortheurope highincome othercountry

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}eastasia {c |}{res}     12,778    .2036312    .4027136          0          1
{txt}{space 9}usa {c |}{res}     12,778    .2085616    .4062962          0          1
{txt}westnorthe~e {c |}{res}     12,778    .3388637     .473342          0          1
{txt}{space 2}highincome {c |}{res}     12,778    .0941462    .2920434          0          1
{txt}othercountry {c |}{res}     12,778    .1547973    .3617255          0          1
{txt}
{com}. 
. // Health Measure
. summ physicalhealth mentalhealth generalhealth selfreported

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
physicalhe~h {c |}{res}     12,778    .3732979    .4836992          0          1
{txt}mentalhealth {c |}{res}     12,778    .2296134    .4206007          0          1
{txt}generalhea~h {c |}{res}     12,778    .4043669    .4907883          0          1
{txt}selfreported {c |}{res}     12,778    .6785099    .4670667          0          1
{txt}
{com}. 
. // Social Capital Measures
. summ cognitivestructual 

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
cognitives~l {c |}{res}     12,778     .921584    .2688357          0          1
{txt}
{com}. summ bondingbridginglinking

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
bondingbri~g {c |}{res}     12,778     .279543    .4487922          0          1
{txt}
{com}. summ numberofscvariables

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
numberofsc~s {c |}{res}     12,768    6.487625    5.352317          1         28
{txt}
{com}. replace numberofscvariables = numberofscvariables - r(mean)
{txt}variable {bf}numberofscvariables{sf} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(12,768 real changes made)

{com}. 
. // Control Variables
. summ age gender education maritalstatus income

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 9}age {c |}{res}     12,778     .852246    .3548698          0          1
{txt}{space 6}gender {c |}{res}     12,778    .8447331    .3621731          0          1
{txt}{space 3}education {c |}{res}     12,778    .5993113    .4900572          0          1
{txt}maritalsta~s {c |}{res}     12,778    .3894976    .4876554          0          1
{txt}{space 6}income {c |}{res}     12,778    .4025669    .4904341          0          1
{txt}
{com}. 
. // Estimation Method
. summ ols orhr hlm fgls probitlogit orderedprobitlogit iv otherestimation

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 9}ols {c |}{res}     12,778    .1393019    .3462749          0          1
{txt}{space 8}orhr {c |}{res}     12,778    .5521991    .4972872          0          1
{txt}{space 9}hlm {c |}{res}     12,778    .1789012    .3832846          0          1
{txt}{space 8}fgls {c |}{res}     12,778    .0167475     .128329          0          1
{txt}{space 1}probitlogit {c |}{res}     12,778    .0528252    .2236931          0          1
{txt}{hline 13}{c +}{hline 57}
orderedpro~t {c |}{res}     12,733    .0308647    .1729578          0          1
{txt}{space 10}iv {c |}{res}     12,778    .0194084    .1379607          0          1
{txt}otherestim~n {c |}{res}     12,733    .0098955    .1280466         -1          1
{txt}
{com}. summ seother seols 

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 5}seother {c |}{res}     12,778    .2552043     .435993          0          1
{txt}{space 7}seols {c |}{res}     12,778    .7453436     .435685          0          1
{txt}
{com}. summ tnormal tcalculatedbypvalue tcalculatedbyci  

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 5}tnormal {c |}{res}     12,778    .2152919    .4110408          0          1
{txt}tcalculat~ue {c |}{res}     12,778    .1784317    .3828907          0          1
{txt}tcalculate~i {c |}{res}     12,778    .6062764    .4885939          0          1
{txt}
{com}. 
. *************************************
. *************************************
. *************************************
. ************ TABLE 5 ****************
. *************************************
. *************************************
. *************************************
. 
. // Generating transformed variables for FE and RE
. gen fetstatR = r/seR
{txt}
{com}. metareg r seR pubyear panel iv individualsc eastasia westnortheurope highincome othercountry ///
> physicalhealth mentalhealth selfreported cognitivestructual bondingbridginglinking ///
> numberofscvariables age gender education maritalstatus income ols orhr hlm ///
> seother tnormal tcalculatedbypvalue, wsse(seR)

{txt}Meta-regression{col 55}Number of obs{col 70}= {res}  12768
REML{txt} estimate of between-study variance{col 55}tau2{col 70}={res} .001498
{txt}% residual variation due to heterogeneity{col 55}I-squared_res{col 70}= {res} 89.87%
{txt}Proportion of between-study variance explained{col 55}Adj R-squared {col 70}= {res} 17.58%
{txt}Joint test for all covariates{col 55}Model F({res}26{txt},{res}12741{txt}){col 70}= {res}  70.06
With{txt} Knapp-Hartung modification{col 55}Prob > F{col 70}= {res} 0.0000
{txt}{hline 16}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}              r{col 17}{c |}      Coef.{col 29}   Std. Err.{col 41}      t{col 49}   P>|t|{col 57}     [95% Con{col 70}f. Interval]
{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 12}seR {c |}{col 17}{res}{space 2} .5384195{col 29}{space 2} .0334417{col 40}{space 1}   16.10{col 49}{space 3}0.000{col 57}{space 4} .4728687{col 70}{space 3} .6039704
{txt}{space 8}pubyear {c |}{col 17}{res}{space 2} .0001479{col 29}{space 2} .0000816{col 40}{space 1}    1.81{col 49}{space 3}0.070{col 57}{space 4}-.0000121{col 70}{space 3} .0003079
{txt}{space 10}panel {c |}{col 17}{res}{space 2}-.0118643{col 29}{space 2} .0010539{col 40}{space 1}  -11.26{col 49}{space 3}0.000{col 57}{space 4}-.0139301{col 70}{space 3}-.0097986
{txt}{space 13}iv {c |}{col 17}{res}{space 2}-.0027016{col 29}{space 2} .0031045{col 40}{space 1}   -0.87{col 49}{space 3}0.384{col 57}{space 4}-.0087868{col 70}{space 3} .0033837
{txt}{space 3}individualsc {c |}{col 17}{res}{space 2} .0124348{col 29}{space 2}  .001465{col 40}{space 1}    8.49{col 49}{space 3}0.000{col 57}{space 4} .0095631{col 70}{space 3} .0153064
{txt}{space 7}eastasia {c |}{col 17}{res}{space 2} .0034067{col 29}{space 2} .0014566{col 40}{space 1}    2.34{col 49}{space 3}0.019{col 57}{space 4} .0005515{col 70}{space 3} .0062618
{txt}westnortheurope {c |}{col 17}{res}{space 2}  .012105{col 29}{space 2} .0012881{col 40}{space 1}    9.40{col 49}{space 3}0.000{col 57}{space 4} .0095801{col 70}{space 3} .0146299
{txt}{space 5}highincome {c |}{col 17}{res}{space 2} .0036526{col 29}{space 2} .0017964{col 40}{space 1}    2.03{col 49}{space 3}0.042{col 57}{space 4} .0001314{col 70}{space 3} .0071737
{txt}{space 3}othercountry {c |}{col 17}{res}{space 2}-.0060975{col 29}{space 2} .0016144{col 40}{space 1}   -3.78{col 49}{space 3}0.000{col 57}{space 4}-.0092619{col 70}{space 3}-.0029331
{txt}{space 1}physicalhealth {c |}{col 17}{res}{space 2}-.0108692{col 29}{space 2} .0015249{col 40}{space 1}   -7.13{col 49}{space 3}0.000{col 57}{space 4}-.0138582{col 70}{space 3}-.0078802
{txt}{space 3}mentalhealth {c |}{col 17}{res}{space 2}-.0063297{col 29}{space 2} .0011471{col 40}{space 1}   -5.52{col 49}{space 3}0.000{col 57}{space 4}-.0085783{col 70}{space 3}-.0040811
{txt}{space 3}selfreported {c |}{col 17}{res}{space 2} .0022591{col 29}{space 2}  .001532{col 40}{space 1}    1.47{col 49}{space 3}0.140{col 57}{space 4}-.0007439{col 70}{space 3} .0052621
{txt}cognitivestru~l {c |}{col 17}{res}{space 2} .0005358{col 29}{space 2} .0017176{col 40}{space 1}    0.31{col 49}{space 3}0.755{col 57}{space 4}-.0028309{col 70}{space 3} .0039025
{txt}bondingbridgi~g {c |}{col 17}{res}{space 2}-.0058962{col 29}{space 2} .0009764{col 40}{space 1}   -6.04{col 49}{space 3}0.000{col 57}{space 4}-.0078101{col 70}{space 3}-.0039824
{txt}numberofscvar~s {c |}{col 17}{res}{space 2}-.0007039{col 29}{space 2} .0000839{col 40}{space 1}   -8.39{col 49}{space 3}0.000{col 57}{space 4}-.0008684{col 70}{space 3}-.0005394
{txt}{space 12}age {c |}{col 17}{res}{space 2}-.0025983{col 29}{space 2} .0014464{col 40}{space 1}   -1.80{col 49}{space 3}0.072{col 57}{space 4}-.0054335{col 70}{space 3} .0002368
{txt}{space 9}gender {c |}{col 17}{res}{space 2}-.0025062{col 29}{space 2}  .001431{col 40}{space 1}   -1.75{col 49}{space 3}0.080{col 57}{space 4}-.0053111{col 70}{space 3} .0002987
{txt}{space 6}education {c |}{col 17}{res}{space 2}-.0046625{col 29}{space 2}  .001117{col 40}{space 1}   -4.17{col 49}{space 3}0.000{col 57}{space 4}-.0068519{col 70}{space 3}-.0024731
{txt}{space 2}maritalstatus {c |}{col 17}{res}{space 2}-.0014452{col 29}{space 2} .0009872{col 40}{space 1}   -1.46{col 49}{space 3}0.143{col 57}{space 4}-.0033802{col 70}{space 3} .0004898
{txt}{space 9}income {c |}{col 17}{res}{space 2}-.0016829{col 29}{space 2} .0010026{col 40}{space 1}   -1.68{col 49}{space 3}0.093{col 57}{space 4}-.0036481{col 70}{space 3} .0002823
{txt}{space 12}ols {c |}{col 17}{res}{space 2} .0036508{col 29}{space 2} .0017614{col 40}{space 1}    2.07{col 49}{space 3}0.038{col 57}{space 4} .0001981{col 70}{space 3} .0071034
{txt}{space 11}orhr {c |}{col 17}{res}{space 2} .0012635{col 29}{space 2} .0016051{col 40}{space 1}    0.79{col 49}{space 3}0.431{col 57}{space 4}-.0018827{col 70}{space 3} .0044097
{txt}{space 12}hlm {c |}{col 17}{res}{space 2}  .003636{col 29}{space 2} .0020734{col 40}{space 1}    1.75{col 49}{space 3}0.080{col 57}{space 4}-.0004282{col 70}{space 3} .0077002
{txt}{space 8}seother {c |}{col 17}{res}{space 2}-.0073209{col 29}{space 2} .0015357{col 40}{space 1}   -4.77{col 49}{space 3}0.000{col 57}{space 4}-.0103311{col 70}{space 3}-.0043107
{txt}{space 8}tnormal {c |}{col 17}{res}{space 2} .0023632{col 29}{space 2} .0013399{col 40}{space 1}    1.76{col 49}{space 3}0.078{col 57}{space 4}-.0002631{col 70}{space 3} .0049895
{txt}tcalculatedb~ue {c |}{col 17}{res}{space 2}-.0221596{col 29}{space 2} .0012666{col 40}{space 1}  -17.50{col 49}{space 3}0.000{col 57}{space 4}-.0246422{col 70}{space 3} -.019677
{txt}{space 10}_cons {c |}{col 17}{res}{space 2} .0217904{col 29}{space 2} .0033746{col 40}{space 1}    6.46{col 49}{space 3}0.000{col 57}{space 4} .0151758{col 70}{space 3} .0284051
{txt}{hline 16}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. scalar tau2 =  e(tau2)
{txt}
{com}. gen revarR = varR + tau2
{txt}
{com}. gen reseR = sqrt(revarR)
{txt}
{com}. gen retstatR = r/reseR
{txt}
{com}. 
. /*
> ******************************************************************************
> * Determining the weight of individual studies (Fixed Effects)
> ******************************************************************************
> gen fevarR = varR
> gen feweightR = 1/fevarR
> gen rR = r*feweightR
> collapse (sum) rR feweightR, by (id)
> gen avgR = rR/feweightR
> gen avgsterrR = sqrt(1/feweightR)
> sort id
> metan avgR avgsterrR, fixed lcols(id) nobox
> gen studyweight = _WT
> summ studyweight, detail
> gsort -studyweight
> // NOTE: The top 3 studies account for approximately 70% of the weight! 
> */
. 
. /*
> ******************************************************************************
> * Determining the weight of individual studies (Random Effects)
> ******************************************************************************
> gen reweightR = 1/revarR
> gen rR = r*reweightR
> collapse (sum) rR reweightR, by (id)
> gen avgR = rR/reweightR
> gen avgsterrR = sqrt(1/reweightR)
> sort id
> metan avgR avgsterrR, random lcols(id) nobox
> gen studyweight = _WT
> summ studyweight, detail
> gsort -studyweight
> // NOTE: Random effects very evenly (too evenly?) weighted
> */
. 
. *************************************
. *************************************
. *************************************
. *********** FIGURE 3  ***************
. *************************************
. *************************************
. *************************************
. 
. ******************************************************************************
. * Funnel Plot for individual estimates
. ******************************************************************************
. // FUNNEL GRAPH
. metafunnel r seR, ylabel(#8) name(funnelA) //name(funnel, replace) nolines

{txt}note: default data input format (theta, se_theta) assumed
{res}{txt}
{com}. metafunnel r seR if seR < 0.2, ylabel(#8) name(funnelAA) //name(funnel, replace) nolines

{txt}note: default data input format (theta, se_theta) assumed
{res}{txt}
{com}. //NOTE: No dramattic evidence of asymmetry in estimates, hence no evidence of publication bias
. //NOTE: But much evidence of random effects!
. 
. ******************************************************************************
. * Funnel Plot for study means
. ******************************************************************************
. //FUNNEL GRAPH
. by id, sort: egen meanr = mean(r)
{txt}
{com}. by id, sort: egen meanseR = mean(seR)
{txt}
{com}. metafunnel meanr meanseR, ylabel(#8) name(funnelB)  //name(funnel, replace) nolines

{txt}note: default data input format (theta, se_theta) assumed
{res}{txt}
{com}. 
. 
. *************************************
. *************************************
. *************************************
. ************ TABLE 6 ****************
. *************************************
. *************************************
. *************************************
. 
. ******************************************************************************
. * Calculating study weights based on number of estimates per study
. ******************************************************************************
. bysort id: egen numberests = count(id)
{txt}
{com}. tabulate numberests 

 {txt}numberests {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          1 {c |}{res}         12        0.09        0.09
{txt}          2 {c |}{res}         46        0.36        0.45
{txt}          3 {c |}{res}         54        0.42        0.88
{txt}          4 {c |}{res}         60        0.47        1.35
{txt}          5 {c |}{res}         60        0.47        1.82
{txt}          6 {c |}{res}        138        1.08        2.90
{txt}          7 {c |}{res}         84        0.66        3.55
{txt}          8 {c |}{res}        192        1.50        5.06
{txt}          9 {c |}{res}         90        0.70        5.76
{txt}         10 {c |}{res}        130        1.02        6.78
{txt}         11 {c |}{res}         66        0.52        7.29
{txt}         12 {c |}{res}        456        3.57       10.86
{txt}         13 {c |}{res}         13        0.10       10.96
{txt}         14 {c |}{res}        210        1.64       12.61
{txt}         15 {c |}{res}        105        0.82       13.43
{txt}         16 {c |}{res}        352        2.75       16.18
{txt}         17 {c |}{res}        102        0.80       16.98
{txt}         18 {c |}{res}        270        2.11       19.10
{txt}         19 {c |}{res}         57        0.45       19.54
{txt}         20 {c |}{res}        220        1.72       21.26
{txt}         21 {c |}{res}         84        0.66       21.92
{txt}         22 {c |}{res}        176        1.38       23.30
{txt}         23 {c |}{res}         46        0.36       23.66
{txt}         24 {c |}{res}        456        3.57       27.23
{txt}         25 {c |}{res}         25        0.20       27.42
{txt}         26 {c |}{res}        104        0.81       28.24
{txt}         27 {c |}{res}        189        1.48       29.72
{txt}         28 {c |}{res}         84        0.66       30.37
{txt}         29 {c |}{res}         58        0.45       30.83
{txt}         30 {c |}{res}        240        1.88       32.70
{txt}         31 {c |}{res}         31        0.24       32.95
{txt}         32 {c |}{res}        288        2.25       35.20
{txt}         33 {c |}{res}         99        0.77       35.98
{txt}         34 {c |}{res}         34        0.27       36.24
{txt}         35 {c |}{res}        245        1.92       38.16
{txt}         36 {c |}{res}        504        3.94       42.10
{txt}         37 {c |}{res}         37        0.29       42.39
{txt}         40 {c |}{res}        200        1.57       43.96
{txt}         42 {c |}{res}        126        0.99       44.94
{txt}         44 {c |}{res}         88        0.69       45.63
{txt}         45 {c |}{res}        135        1.06       46.69
{txt}         46 {c |}{res}         46        0.36       47.05
{txt}         48 {c |}{res}        288        2.25       49.30
{txt}         49 {c |}{res}         98        0.77       50.07
{txt}         50 {c |}{res}        200        1.57       51.64
{txt}         51 {c |}{res}        102        0.80       52.43
{txt}         54 {c |}{res}        108        0.85       53.28
{txt}         55 {c |}{res}        110        0.86       54.14
{txt}         56 {c |}{res}         56        0.44       54.58
{txt}         57 {c |}{res}         57        0.45       55.02
{txt}         60 {c |}{res}        480        3.76       58.78
{txt}         64 {c |}{res}        128        1.00       59.78
{txt}         65 {c |}{res}         65        0.51       60.29
{txt}         68 {c |}{res}        136        1.06       61.36
{txt}         70 {c |}{res}         70        0.55       61.90
{txt}         72 {c |}{res}        288        2.25       64.16
{txt}         73 {c |}{res}         73        0.57       64.73
{txt}         76 {c |}{res}        152        1.19       65.92
{txt}         77 {c |}{res}         77        0.60       66.52
{txt}         78 {c |}{res}         78        0.61       67.13
{txt}         80 {c |}{res}        240        1.88       69.01
{txt}         84 {c |}{res}         84        0.66       69.67
{txt}         87 {c |}{res}         87        0.68       70.35
{txt}         93 {c |}{res}         93        0.73       71.08
{txt}         96 {c |}{res}        384        3.01       74.08
{txt}        102 {c |}{res}        102        0.80       74.88
{txt}        104 {c |}{res}        104        0.81       75.69
{txt}        108 {c |}{res}        108        0.85       76.54
{txt}        110 {c |}{res}        110        0.86       77.40
{txt}        120 {c |}{res}        240        1.88       79.28
{txt}        121 {c |}{res}        121        0.95       80.22
{txt}        124 {c |}{res}        124        0.97       81.19
{txt}        127 {c |}{res}        127        0.99       82.19
{txt}        128 {c |}{res}        256        2.00       84.19
{txt}        136 {c |}{res}        136        1.06       85.26
{txt}        138 {c |}{res}        276        2.16       87.42
{txt}        140 {c |}{res}        140        1.10       88.51
{txt}        143 {c |}{res}        143        1.12       89.63
{txt}        148 {c |}{res}        148        1.16       90.79
{txt}        152 {c |}{res}        152        1.19       91.98
{txt}        160 {c |}{res}        160        1.25       93.23
{txt}        172 {c |}{res}        172        1.35       94.58
{txt}        225 {c |}{res}        225        1.76       96.34
{txt}        228 {c |}{res}        228        1.78       98.12
{txt}        240 {c |}{res}        240        1.88      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}     12,778      100.00
{txt}
{com}. gen weight = 1/numberests
{txt}
{com}. 
. 
. ******************************************************************************
. * FAT/PET
. ******************************************************************************
. 
. ******************************************************************************
. * FIXED EFFECTS
. ******************************************************************************
. // Correcting for heteroskedasticity
. gen feprecisionR = 1/seR
{txt}
{com}. 
. // Equal weight to each estimate (Column 1)
. regress fetstatR feprecisionR, vce(cluster id)

{txt}Linear regression                               Number of obs     = {res}    12,778
                                                {txt}F(1, 469)         =  {res}     2.11
                                                {txt}Prob > F          = {res}    0.1474
                                                {txt}R-squared         = {res}    0.0248
                                                {txt}Root MSE          =    {res} 3.4833

{txt}{ralign 78:(Std. Err. adjusted for {res:470} clusters in id)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}    fetstatR{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
feprecisionR {c |}{col 14}{res}{space 2} .0037435{col 26}{space 2} .0025796{col 37}{space 1}    1.45{col 46}{space 3}0.147{col 54}{space 4}-.0013256{col 67}{space 3} .0088126
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 1.269185{col 26}{space 2} .2141189{col 37}{space 1}    5.93{col 46}{space 3}0.000{col 54}{space 4} .8484343{col 67}{space 3} 1.689937
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. // Equal weight to each study (Column (2)
. regress fetstatR feprecisionR [pweight = weight], vce(cluster id)
{txt}(sum of wgt is 470)

Linear regression                               Number of obs     = {res}    12,778
                                                {txt}F(1, 469)         =  {res}     8.26
                                                {txt}Prob > F          = {res}    0.0042
                                                {txt}R-squared         = {res}    0.0478
                                                {txt}Root MSE          =    {res} 4.1248

{txt}{ralign 78:(Std. Err. adjusted for {res:470} clusters in id)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}    fetstatR{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
feprecisionR {c |}{col 14}{res}{space 2} .0074641{col 26}{space 2} .0025965{col 37}{space 1}    2.87{col 46}{space 3}0.004{col 54}{space 4} .0023618{col 67}{space 3} .0125663
{txt}{space 7}_cons {c |}{col 14}{res}{space 2}  1.49096{col 26}{space 2} .2137461{col 37}{space 1}    6.98{col 46}{space 3}0.000{col 54}{space 4} 1.070942{col 67}{space 3} 1.910979
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. ******************************************************************************
. * RANDOM EFFECTS 
. ******************************************************************************
. // Correcting for heteroskedasticity
. gen reprecisionR = 1/reseR
{txt}
{com}. gen repubbiasR = seR/reseR
{txt}
{com}. 
. // Equal weight to each estimate (Column 3)
. regress retstatR repubbiasR reprecisionR ,  noc vce(cluster id)

{txt}Linear regression                               Number of obs     = {res}    12,778
                                                {txt}F(2, 469)         =  {res}   102.43
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.2091
                                                {txt}Root MSE          =    {res} 1.1017

{txt}{ralign 78:(Std. Err. adjusted for {res:470} clusters in id)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}    retstatR{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}repubbiasR {c |}{col 14}{res}{space 2} .5985375{col 26}{space 2} .1122841{col 37}{space 1}    5.33{col 46}{space 3}0.000{col 54}{space 4} .3778952{col 67}{space 3} .8191797
{txt}reprecisionR {c |}{col 14}{res}{space 2} .0133599{col 26}{space 2} .0025956{col 37}{space 1}    5.15{col 46}{space 3}0.000{col 54}{space 4} .0082594{col 67}{space 3} .0184604
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. // Equal weight to each study (Column 4)
. regress retstatR repubbiasR reprecisionR [pweight = weight], noc vce(cluster id)
{txt}(sum of wgt is 470)

Linear regression                               Number of obs     = {res}    12,778
                                                {txt}F(2, 469)         =  {res}   136.43
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.2367
                                                {txt}Root MSE          =    {res} 1.3037

{txt}{ralign 78:(Std. Err. adjusted for {res:470} clusters in id)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}    retstatR{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}repubbiasR {c |}{col 14}{res}{space 2} .5510408{col 26}{space 2} .1268447{col 37}{space 1}    4.34{col 46}{space 3}0.000{col 54}{space 4} .3017866{col 67}{space 3}  .800295
{txt}reprecisionR {c |}{col 14}{res}{space 2} .0216204{col 26}{space 2} .0028869{col 37}{space 1}    7.49{col 46}{space 3}0.000{col 54}{space 4} .0159475{col 67}{space 3} .0272933
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. ******************************************************************************
. * ESTIMATE OF OVERALL EFFECT WITHOUT CORRECTING FOR PUBLICATION BIAS
. ******************************************************************************
. 
. // RANDOM EFFECTS
. // Equal weight to each estimate (Column 5) 
. regress retstatR reprecisionR,  noc vce(cluster id)

{txt}Linear regression                               Number of obs     = {res}    12,778
                                                {txt}F(1, 469)         =  {res}   163.47
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.1887
                                                {txt}Root MSE          =    {res} 1.1158

{txt}{ralign 78:(Std. Err. adjusted for {res:470} clusters in id)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}    retstatR{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
reprecisionR {c |}{col 14}{res}{space 2} .0239893{col 26}{space 2} .0018763{col 37}{space 1}   12.79{col 46}{space 3}0.000{col 54}{space 4} .0203023{col 67}{space 3} .0276762
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. //Equal weight to each study (Column 6)
. regress retstatR reprecisionR [pweight = weight], noc vce(cluster id)
{txt}(sum of wgt is 470)

Linear regression                               Number of obs     = {res}    12,778
                                                {txt}F(1, 469)         =  {res}   261.47
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.2221
                                                {txt}Root MSE          =    {res}  1.316

{txt}{ralign 78:(Std. Err. adjusted for {res:470} clusters in id)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}    retstatR{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
reprecisionR {c |}{col 14}{res}{space 2} .0320744{col 26}{space 2} .0019836{col 37}{space 1}   16.17{col 46}{space 3}0.000{col 54}{space 4} .0281767{col 67}{space 3} .0359722
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}\\file\UsersW$\wrr15\Home\My Documents\My Files\XINDONG XUE\META-ANALYSIS\REVISION FOR JHE\DATA AND CODE\Part1 Results(20191130).smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}30 Nov 2019, 10:50:29
{txt}{.-}
{smcl}
{txt}{sf}{ul off}